﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StudentSearch.aspx.cs"
    Inherits="School.Pages.Admission.StudentSearch" MasterPageFile="~/MasterALSafa.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            <div id="displaybox">
                <div>
                    جارى تنفيذ الأمر</div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>
    <div align="center">
        <asp:Panel ID="pnlbrows" runat="server" Visible="true">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td class="admintitle">
                        شاشة ملف الطالب</td>
                </tr>
                <tr>
                    <td class="admintitle" style="text-align: right">
                        البحث</td>
                </tr>
                <tr>
                    <td>
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
                            <tr>
                                <td>
                                    رقم القيد
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchRegistrationNumber" runat="server" CssClass="text" 
                                        Width="150px"></asp:TextBox>
                                </td>
                                <td>
                                    رقم الملف
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchFileNumber" runat="server" CssClass="text" 
                                        Width="150px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblFirstname1" runat="server" CssClass="lab" Text="الاسم"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Label ID="Label2" runat="server" CssClass="lab" Text="المجمع"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchcampus_Id" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="ddlSearchcampus_Id_SelectedIndexChanged1" Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td align="right" rowspan="3">
                                <asp:Button ID="Button1" runat="server" CssClass="graybutton" 
                                         Text="بحث تفصيلى" onclick="Button1_Click" />
                                    <asp:RadioButtonList ID="rblSearchType" runat="server" Visible="False">
                                        <asp:ListItem Selected="True" Text="بداية الاسم" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="اي جزء من الاسم" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="مطابق" Value="2"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td>
                                    <asp:Label ID="lblCertificate_Id0" runat="server" CssClass="lab" 
                                        Text="نوع الشهادة"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchCertificate_Id" runat="server" 
                                        AutoPostBack="True" Enabled="False" 
                                        onselectedindexchanged="ddlSearchCertificate_Id_SelectedIndexChanged" 
                                        Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Label ID="lblStage_Id0" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchStage_Id" runat="server" AutoPostBack="True" 
                                        Enabled="False" onselectedindexchanged="ddlSearchStage_Id_SelectedIndexChanged" 
                                        Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 22px">
                                    &nbsp;
                                </td>
                                <td style="height: 22px">
                                    <asp:Label ID="lblGrade_Id0" runat="server" CssClass="lab" Text="الصف"></asp:Label>
                                </td>
                                <td align="right" style="height: 22px">
                                    <asp:DropDownList ID="ddlSearchGrade_ID" runat="server" Enabled="False" 
                                        Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr style="display:none">
                                <td colspan="2">
                                    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
                                        OnCheckedChanged="CheckBox1_CheckedChanged" Text="اولياء الأمور" />
                                </td>
                                <td colspan="2">
                                    <asp:RadioButtonList ID="rblRelatives" runat="server" AutoPostBack="True" 
                                        OnSelectedIndexChanged="rblRelatives_SelectedIndexChanged" 
                                        RepeatDirection="Horizontal">
                                        <asp:ListItem Text="الأب" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="الأم" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="الواصي" Value="2"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td colspan="3" rowspan="4">
                                    <asp:Panel ID="pnl2" runat="server" Visible="false">
                                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend>البيانات الشخصية</legend>
                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" 
                                                            class="table_text" width="90%">
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="lblFAr_FirstName" runat="server" CssClass="lab" Text="الاسم"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:TextBox ID="txtRelativeName" runat="server" CssClass="text" Width="233px"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td align="right">
                                                                    <asp:RadioButtonList ID="rblSearchType0" runat="server" 
                                                                        RepeatDirection="Horizontal">
                                                                        <asp:ListItem Selected="True" Text="بداية الاسم" Value="0"></asp:ListItem>
                                                                        <asp:ListItem Text="اي جزء من الاسم" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="مطابق" Value="2"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="lblFCountry_Id" runat="server" CssClass="lableface" 
                                                                        Text="الجنسية"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:DropDownList ID="ddlSearchNationality_Id" runat="server">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend>بيانات المؤهل العلمي</legend>
                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" 
                                                            class="table_text" width="80%">
                                                            <tr>
                                                                <td width="114">
                                                                    <asp:Label ID="lblFQualification_Id" runat="server" CssClass="lab" 
                                                                        Text="المؤهل العلمي"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:DropDownList ID="ddlFQualification_Id" runat="server" CssClass="text" 
                                                                        Width="100px">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="lblFSpecialization" runat="server" CssClass="lab" Text="التخصص"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:TextBox ID="txtFSpecialization" runat="server" CssClass="text" 
                                                                        Width="100px"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="lblFPointOfGraduation" runat="server" CssClass="lab" 
                                                                        Text="جهة التخرج"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:TextBox ID="txtFPointOfGraduation" runat="server" CssClass="text" 
                                                                        Width="100px"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend>بيانات العمل</legend>
                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" 
                                                            class="table_text" width="80%">
                                                            <tr>
                                                                <td width="114">
                                                                    <asp:Label ID="lblFCareer" runat="server" CssClass="lab" Text="الوظيفة"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:DropDownList ID="ddlFCareer" runat="server" CssClass="text" Width="100px">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="lblFCompanyName" runat="server" CssClass="lab" Text="الشركة"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:TextBox ID="txtFCompanyName" runat="server" CssClass="text" Width="100px"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend>بيانات السكن</legend>
                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" 
                                                            class="table_text" width="80%">
                                                            <tr>
                                                                <td>
                                                                    الشارع
                                                                </td>
                                                                <td align="right">
                                                                    <asp:TextBox ID="txtStreetName" runat="server" CssClass="text" Width="100px"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="Label5" runat="server" CssClass="lab" Text="المنطقة"></asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:DropDownList ID="ddlDistrict_Id" runat="server" CssClass="text" 
                                                                        Width="100px">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Panel ID="pnl4" runat="server" Visible="false">
                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                            <tr>
                                                                <td>
                                                                    <fieldset>
                                                                        <legend>صلة قرابة الوصي </legend>
                                                                        <table align="center" border="0" cellpadding="0" cellspacing="0" 
                                                                            class="table_text" width="80%">
                                                                            <tr>
                                                                                <td width="114">
                                                                                    <asp:Label ID="lblCParentsSocialStatus_Id" runat="server" CssClass="lableface" 
                                                                                        Text="الحالة الاجتماعية"></asp:Label>
                                                                                </td>
                                                                                <td align="right">
                                                                                    <asp:DropDownList ID="ddlParentsSocialStatus_Id" runat="server" CssClass="text" 
                                                                                        Width="100px">
                                                                                    </asp:DropDownList>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblCCustodyType_Id" runat="server" CssClass="lableface" 
                                                                                        Text="الوصي علي الطالب"></asp:Label>
                                                                                </td>
                                                                                <td align="right">
                                                                                    <asp:DropDownList ID="ddlCustodyType_Id" runat="server" CssClass="text" 
                                                                                        Width="100px">
                                                                                    </asp:DropDownList>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblCStudentLivingPlace_Id" runat="server" CssClass="lableface" 
                                                                                        Text="اين يعيش الطالب"></asp:Label>
                                                                                </td>
                                                                                <td align="right">
                                                                                    <asp:DropDownList ID="ddlStudentLivingPlace_Id" runat="server" CssClass="text" 
                                                                                        Width="100px">
                                                                                    </asp:DropDownList>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td colspan="2">
                                                                                    <asp:Label ID="lblCtitile" runat="server" CssClass="lableface" 
                                                                                        Text="اذا كان الواصي او يعيش الطالب مع شخص اخر غير الاب و الام"></asp:Label>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblCRelationToStudent" runat="server" CssClass="lableface" 
                                                                                        Text="العلاقة بالطالب"></asp:Label>
                                                                                </td>
                                                                                <td align="right">
                                                                                    <asp:TextBox ID="txtCRelationToStudent" runat="server" CssClass="text" 
                                                                                        Width="100px">
                                                                                    </asp:TextBox>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </fieldset>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Button ID="btnSearch" runat="server" CssClass="graybutton" 
                                        OnClick="btnSearch_Click" Text="بحث" />
                                    &nbsp;&nbsp;<asp:Button ID="btnGetAll" runat="server" CssClass="graybutton" 
                                        OnClick="btnGetAll_Click" Text="الكل" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: right">
                                    <asp:Label ID="lblRecordNo" runat="server" CssClass="admintitle"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:GridView ID="griddata" runat="server" AllowPaging="True" 
                                        AllowSorting="True" AlternatingRowStyle-CssClass="GridItemAltername" 
                                        AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" 
                                        FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter" 
                                        OnPageIndexChanging="griddata_PageIndexChanging" 
                                        OnRowDataBound="griddata_RowDataBound" OnRowDeleting="griddata_RowDeleting" 
                                        OnSelectedIndexChanged="griddata_SelectedIndexChanged" 
                                        PagerStyle-CssClass="GridPager" Width="100%" PageSize="50">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:BoundField DataField="RegistrationNumber" HeaderText="رقم القيد" />
                                            <asp:BoundField DataField="FileNumber" HeaderText="رقم الملف" />
                                            <asp:TemplateField HeaderText="الاسم الكامل">
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" 
                                                        Text='<%# Eval("FullName").ToString()%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="القسم">
                                                <ItemTemplate>
                                                    <asp:Label ID="CertificateLable" runat="server" 
                                                        Text='<%# Eval("CertificateName").ToString()%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الصف">
                                                <ItemTemplate>
                                                    <asp:Label ID="GradeLable" runat="server" 
                                                        Text='<%# Eval("GradeName").ToString()%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:HyperLinkField DataNavigateUrlFields="Id" 
                                                DataNavigateUrlFormatString="AddStudent.aspx?sid={0}" 
                                                Text="ادخال بيانات الطالب" Target="_blank" />
                                            <asp:HyperLinkField DataNavigateUrlFields="Id" 
                                                DataNavigateUrlFormatString="Student_Attachment.aspx?sid={0}" 
                                                Text="مرفقات" />
                                            <asp:CommandField SelectText="عرض" ShowSelectButton="True" Visible="false" />
                                            <asp:TemplateField ShowHeader="False">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                        CommandName="Delete" Text="حذف"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Label ID="lblMessage" runat="server" CssClass="error"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    <asp:Panel ID="pnldetails" runat="server" Visible="false">
        <div align="center" id="DivContent">
        </div>
        <div align="center" id="DivContent2">
            <table align="center" cellpadding="0" cellspacing="0" border="0" width="90%" dir="rtl">
                <tr>
                    <td class="admintitle" colspan="3">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:DetailsView Width="100%" ID="DetViewdata" runat="server" AlternatingRowStyle-CssClass="GridItemAltername"
                            CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" HeaderStyle-Width="30%"
                            AutoGenerateRows="False">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Fields>
                                <asp:BoundField DataField="FileNumber" HeaderText="رقم أمر الدفع" />
                                <asp:BoundField DataField="RegistrationNumber" HeaderText="التاريخ" />
                                <asp:BoundField DataField="Ar_FirstName" HeaderText="االاسم الاول" />
                            </Fields>
                            <HeaderStyle CssClass="GridHeaderFooter" Width="30%" />
                        </asp:DetailsView>
                    </td>
                </tr>
            </table>
        </div>
        <table align="center" cellpadding="0" cellspacing="0" border="0" width="50%" dir="rtl">
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <input type="button" value="رجوع" onclick="history.go(-1)" class="graybutton" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
